/**
 * Copyright &copy; 2012-2016 civet All rights reserved.
 */
package cn.mcsys.myadmin.modules.order.entity;

import javax.validation.constraints.NotNull;

import cn.mcsys.myadmin.common.persistence.DataEntity;
import cn.mcsys.myadmin.modules.sys.entity.User;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
import cn.mcsys.myadmin.modules.sys.entity.User;

import cn.mcsys.myadmin.common.persistence.DataEntity;

/**
 * 商品订单Entity
 * @author Jockey
 * @version 2016-11-20
 */
public class GoodsOrder extends DataEntity<GoodsOrder> {
	
	private static final long serialVersionUID = 1L;
	private Integer goodsId;		// 商品ID
	private String goodsName;		// 商品名称
	private double num;		// 商品数量
	private double costPrice;		// 成本价格
	private double salePrice;		// 销售价格
	private double totalPrice;//销售总价
	private String unit;		// 计量单位：1斤2个3盒4箱5袋
	private String status;		// 订单状态（1：已付款 2：配送中 3：已完成 4：已退单）
	private User user;		// 客户ID
	private Date beginCreateDate;		// 开始 下单时间
	private Date endCreateDate;		// 结束 下单时间
	
	public GoodsOrder() {
		super();
	}

	public GoodsOrder(Integer id){
		super(id);
	}

	@NotNull(message="商品ID不能为空")
	public Integer getGoodsId() {
		return goodsId;
	}
	public void setGoodsId(Integer goodsId) {
		this.goodsId = goodsId;
	}
	
	@Length(min=1, max=100, message="商品名称长度必须介于 1 和 100 之间")
	public String getGoodsName() {
		return goodsName;
	}
	public void setGoodsName(String goodsName) {
		this.goodsName = goodsName;
	}
	
	public double getNum() {
		return num;
	}
	public void setNum(double num) {
		this.num = num;
	}
	
	public double getCostPrice() {
		return costPrice;
	}
	public void setCostPrice(double costPrice) {
		this.costPrice = costPrice;
	}
	
	public double getSalePrice() {
		return salePrice;
	}
	public void setSalePrice(double salePrice) {
		this.salePrice = salePrice;
	}
	
	@Length(min=0, max=1, message="计量单位：1斤2个3盒4箱5袋长度必须介于 0 和 1 之间")
	public String getUnit() {
		return unit;
	}
	public void setUnit(String unit) {
		this.unit = unit;
	}

	public double getTotalPrice() {
		return totalPrice;
	}
	public void setTotalPrice(double totalPrice) {
		this.totalPrice = totalPrice;
	}

	@Length(min=0, max=1, message="订单状态（1：已付款 2：配送中 3：已完成 4：已退单）长度必须介于 0 和 1 之间")
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	
	public Date getBeginCreateDate() {
		return beginCreateDate;
	}
	public void setBeginCreateDate(Date beginCreateDate) {
		this.beginCreateDate = beginCreateDate;
	}
	
	public Date getEndCreateDate() {
		return endCreateDate;
	}
	public void setEndCreateDate(Date endCreateDate) {
		this.endCreateDate = endCreateDate;
	}
		
}